BUILD: Clone the Linux tree if it wasn't found via $(LINUX_SRC_PATH)
authorIan Campbell <ian.campbell@xensource.com>
Tue, 5 Jun 2007 07:57:53 +0000 (08:57 +0100)
committerIan Campbell <ian.campbell@xensource.com>
Tue, 5 Jun 2007 07:57:53 +0000 (08:57 +0100)
even if it happens to be a local directory.

If we located the Linux tree by deriving the path from "hg path
default" and it is a local path then prepend "file://" to prevent us
trying to symlink it.

Unfortunately mercurial doesn't understand file:// URLs so we have to
strip it off again before calling hg clone.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
buildconfigs/select-repository
buildconfigs/src.hg-clone

index db46049adb56e036c6bc6b6c5c506498af6cb899..ef1df59ac33bc52b04fca000c46e200a75f745f3 100755 (executable)
@@ -45,5 +45,14 @@ if [ $? -ne 0 ] || [ X"$XEN" = "X" ] ; then
 fi
 
 echo "$ME: Found ${BASE}/${REPO}" 1>&2
-echo ${BASE}/${REPO}
+
+# If ${BASE}/${REPO} is a local directory then prepend file:// so that
+# the test in src.hg-clone will fail and we will clone instead of
+# linking this repository. We only want to link repositories which
+# were found via LINUX_SRC_PATH.
+if [ -d "${BASE}/${REPO}" ] ; then
+    echo "file://${BASE}/${REPO}"
+else
+    echo ${BASE}/${REPO}
+fi
 exit 0
index d3696172d0add03cdd06e423795f977fdf8ac5fe..e1d7913c61f4f594bbef0af12cf28d0c60394210 100644 (file)
@@ -28,7 +28,7 @@ $(LINUX_SRCDIR)/.valid-src: $(__XEN_LINUX_UPDATE)
                ln -s $${__repo} $(LINUX_SRCDIR) ; \
            else \
                echo "Cloning $${__repo} to $(LINUX_SRCDIR)." ; \
-               $(HG) clone $${__repo} $(LINUX_SRCDIR) ; \
+               $(HG) clone $${__repo#file://} $(LINUX_SRCDIR) ; \
            fi ; \
        else \
            __parent=$$($(HG) -R $(LINUX_SRCDIR) path default) ; \